﻿using System;

namespace TMT_CMS.BL.Excel.AttributeUtility
{
    public enum DataType
    {
        String,
        Float,
        DateTime,
        ShortInt,
        Int,
        Long,
        Bool
    }

    [AttributeUsage(AttributeTargets.Property)]
    public class DataAttribute : Attribute
    {
        private readonly string _dataName;
        private readonly string _excelColumnName;
        private readonly DataType _dataType;

        public DataAttribute(string dataName, DataType dataType)
            : this(dataName, dataType, string.Empty)
        {

        }

        public DataAttribute(DataType dataType, string excelColumnName)
            : this(string.Empty, dataType, excelColumnName)
        {

        }

        public DataAttribute(string dataName, DataType dataType, string excelColumnName)
        {
            _dataName = dataName;
            _dataType = dataType;
            _excelColumnName = excelColumnName;
        }

        public string DataName
        {
            get
            {
                return _dataName;
            }
        }

        public DataType DataType
        {
            get
            {
                return _dataType;
            }
        }

        public string ExcelColumnName
        {
            get
            {
                return _excelColumnName;
            }
        }
    }
}
